import Vue from 'vue'
import ElementUI from 'element-ui'
import App from './App.vue'
import http from './util/http'
import router from './router/index'
import store from './store/index'
import api from './api/index'
import './util/routerBeforeEach'
import VueSocketio from 'vue-socket.io'
import socketio from 'socket.io-client'
import '../theme/index.css'

import "./assets/index.scss"

Vue.use(ElementUI)
Vue.use(VueSocketio,  socketio(process.env.SOCKET_URL))
// 将api挂载到vue的原型上
Vue.prototype.$api = api
// 创建和挂载根实例。
// 记得要通过 router 配置参数注入路由，
// 从而让整个应用都有路由功能
const app = new Vue({
  router,
  store,
  http,
  render: h => h(App)  //渲染函数，没有render那页面什么都不会出来
}).$mount('#app')